/*
 *  ==== DO NOT MODIFY THIS FILE - CHANGES WILL BE OVERWRITTEN ====
 *
 *  Generated from
 *      C:/Arquivos de programas/Texas Instruments/ccsv42/grace_1_00_01_83/packages/ti/mcu/msp430/csl/timer/ITimerx_B_init.xdt
 */

#include <ti/mcu/msp430/include/msp430.h>

/*
 *  ======== Timer_B3_init ========
 *  Initialize MSP430 Timer_B timer
 */
void Timer_B3_init(void)
{
    /* 
     * TBCCTL1, Capture/Compare Control Register 1
     * 
     * CM_0 -- No Capture
     * CCIS_0 -- CCIxA
     * OUTMOD_7 -- PWM output mode: 7 - PWM reset/set
     */
    TBCCTL1 = CM_0 + CCIS_0 + CLLD_0 + OUTMOD_7;

    /* 
     * TBCCTL2, Capture/Compare Control Register 2
     * 
     * CM_0 -- No Capture
     * CCIS_0 -- CCIxA
     * OUTMOD_7 -- PWM output mode: 7 - PWM reset/set
     */
    TBCCTL2 = CM_0 + CCIS_0 + CLLD_0 + OUTMOD_7;

    /* TBCCR0, Timer_B Capture/Compare Register 0 */
    TBCCR0 = 51;

    /* TBCCR1, Timer_B Capture/Compare Register 1 */
    TBCCR1 = 25;

    /* TBCCR2, Timer_B Capture/Compare Register 2 */
    TBCCR2 = 51;

    /* 
     * TBCTL, Timer_B3 Control Register
     * 
     * CNTL_0 -- 16-bit, TBR(max) = 0FFFFh
     * TBSSEL_2 -- SMCLK
     * ID_1 -- Divider - /2
     * MC_1 -- Up Mode
     */
    TBCTL = TBCLGRP_0 + CNTL_0 + TBSSEL_2 + ID_1 + MC_1;
}
